package com.ruoyi.archive.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.archive.mapper.SFamilyOfActiveSoldierMapper;
import com.ruoyi.archive.domain.SFamilyOfActiveSoldier;
import com.ruoyi.archive.service.ISFamilyOfActiveSoldierService;

/**
 * 现役军人家属信息Service业务层处理
 *
 * @author Allen
 * @date 2021-09-30
 */
@Service
public class SFamilyOfActiveSoldierServiceImpl extends ServiceImpl<SFamilyOfActiveSoldierMapper, SFamilyOfActiveSoldier> implements ISFamilyOfActiveSoldierService {
    @Autowired
    private SFamilyOfActiveSoldierMapper sFamilyOfActiveSoldierMapper;

    /**
     * 查询现役军人家属信息
     *
     * @param id
     *         现役军人家属信息主键
     *
     * @return 现役军人家属信息
     */
    @Override
    public SFamilyOfActiveSoldier selectSFamilyOfActiveSoldierById(Long id) {
        return sFamilyOfActiveSoldierMapper.selectSFamilyOfActiveSoldierById(id);
    }

    /**
     * 查询现役军人家属信息列表
     *
     * @param sFamilyOfActiveSoldier
     *         现役军人家属信息
     *
     * @return 现役军人家属信息
     */
    @Override
    public List<SFamilyOfActiveSoldier> selectSFamilyOfActiveSoldierList(SFamilyOfActiveSoldier sFamilyOfActiveSoldier) {
        return sFamilyOfActiveSoldierMapper.selectSFamilyOfActiveSoldierList(sFamilyOfActiveSoldier);
    }

    /**
     * 新增现役军人家属信息
     *
     * @param sFamilyOfActiveSoldier
     *         现役军人家属信息
     *
     * @return 结果
     */
    @Override
    public int insertSFamilyOfActiveSoldier(SFamilyOfActiveSoldier sFamilyOfActiveSoldier) {
        if (sFamilyOfActiveSoldier != null) {
            return sFamilyOfActiveSoldierMapper.insertSFamilyOfActiveSoldier(sFamilyOfActiveSoldier);
        }
        return 0;
    }

    /**
     * 修改现役军人家属信息
     *
     * @param sFamilyOfActiveSoldier
     *         现役军人家属信息
     *
     * @return 结果
     */
    @Override
    public int updateSFamilyOfActiveSoldier(SFamilyOfActiveSoldier sFamilyOfActiveSoldier) {
        return sFamilyOfActiveSoldierMapper.updateSFamilyOfActiveSoldier(sFamilyOfActiveSoldier);
    }

    /**
     * 批量删除现役军人家属信息
     *
     * @param ids
     *         需要删除的现役军人家属信息主键
     *
     * @return 结果
     */
    @Override
    public int deleteSFamilyOfActiveSoldierByIds(Long[] ids) {
        return sFamilyOfActiveSoldierMapper.deleteSFamilyOfActiveSoldierByIds(ids);
    }

    /**
     * 删除现役军人家属信息信息
     *
     * @param id
     *         现役军人家属信息主键
     *
     * @return 结果
     */
    @Override
    public int deleteSFamilyOfActiveSoldierById(Long id) {
        return sFamilyOfActiveSoldierMapper.deleteSFamilyOfActiveSoldierById(id);
    }
}
